Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocating SLH for http server with configuring httpHeapMaxBlocks in yaml #447

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

Gautham-coder
Copy link
Contributor

Proposed changes

The heap available to the http server is currently capped to around 6MB, because of this there is a limit in the size of the dataset that can be uploaded using ZSS API's.
To solve this, we are providing an option in configuration under 'components ->zss ->httpHeapMaxBlocks'. By default it would be 1024 meaning, 64KB * 1024, and as of now we have capped the max value of this option to be 4096 meaning, 64kb * 4096.

This PR addresses Issue: zowe/zss#698

This PR depends upon the following PRs:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Change in a documentation
  • Refactor the code
  • Chore, repository cleanup, updates the dependencies.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

PR Checklist

Please delete options that are not relevant.

  • If the changes in this PR are meant for the next release / mainline, this PR targets the "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • video or image is included if visual changes are made
  • Relevant update to CHANGELOG.md
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works, or describe a test method below

Testing

You can try with uploading a dataset with size greater than 6mb using a python script

c/httpserver.c Show resolved Hide resolved
h/httpserver.h Outdated
@@ -220,6 +224,7 @@ typedef struct HTTPServerConfig_tag {
hashtable *userTimeouts;
hashtable *groupTimeouts;
int defaultTimeout;
unsigned int httpHeapMaxBlocks;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a more specific name; for example, httpRequestHeapMaxBlocks.

@@ -5821,7 +5821,9 @@ static int httpHandleTCP(STCBase *base,
}
}
#endif // USE_ZOWE_TLS
ShortLivedHeap *slh = makeShortLivedHeap(READ_BUFFER_SIZE,100);
HttpServer *server = (HttpServer*) module->data;
unsigned int maxBlocks = server->config->httpRequestHeapMaxBlocks;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field should probably be initialized by this point in the httpserver.c code. The reason is, the httpserver.c might be used by non-zss applications which don't know about this filed and might not initialize it.

@Gautham-coder Gautham-coder reopened this May 30, 2024
Copy link
Contributor

@ifakhrutdinov ifakhrutdinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@JoeNemo JoeNemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@JoeNemo JoeNemo merged commit be02654 into v2.x/staging Jun 5, 2024
17 checks passed
@ifakhrutdinov ifakhrutdinov deleted the config-slh-maxblocks branch June 5, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants